<?php include('_init_.php'); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
<link href="../css/admin-body.css" rel="stylesheet" type="text/css" />
<link href="../css/admin-epaperlist.css" rel="stylesheet" type="text/css" />
<script type="text/javascript" src="../js/jquery-1.4.2.min.js"></script>
<title>班尼頓寫真後台管理</title>
<script type="text/javascript">
$(function(){
	$('.ck_epaper').click(function(){
		   $('.ck_epaper').attr('checked',false);
		   $(this).attr('checked',true);
		      
		});
}
);
function select_epaper()
{
   if ( $('.ck_epaper:checked').length == 0) 
   {
	   alert("請選擇您要發送的電子報");
	   return false;
   }
	var epaper_id = $('.ck_epaper:checked').val();
	var epaper_subject = $('#epaper_subject_'+epaper_id).text();
	 parent.selected_epaper(epaper_id, epaper_subject);
	 return false;
}
</script>
</head>

<body>
<?php 
$dt = new DataTable(constant('DB_TABLE_EPAPER_CONTENT'));
$condition = '';
$GLOBALS['PAGE_LIST_DATA'] = $dt->get_list($condition, array('-date','-id'));
?>
<div id="contactall" class="clearfix">
  <div id="tit">選擇您要發送的電子報</div>
  
  <div id="contact">
  <ul>
  <li class="lis-a">選擇</li>
  <li class="lis-b">主旨</li>
  </ul>
   <?php foreach($GLOBALS['PAGE_LIST_DATA'] as $row):?>
    <ul>
  <li class="lis-a"><input class="ck_epaper" name="epaper_id_"<?php echo $row['id'];?> type="checkbox" value="<?php echo $row['id'];?>" /></li>  
  <li class="lis-b" id="epaper_subject_<?php echo $row['id'];?>"><?php echo $row['subject'];?></li>
  </ul>
   <?php endforeach;?>
  
  <ul>
  <li class="lis-c"><a href="#" onclick="return select_epaper();">確定</a></li>
  </ul>
  </div>
  
</div>

</body>
</html>